package com.xadmin.sys.rbac.utils;

import com.xadmin.sys.rbac.vo.MenuVo;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author vic Ly
 */
public class FindRoot {

    public static List<MenuVo> findMenuRoot(List<MenuVo> menuVoList){
        List<MenuVo> rootMenu = new ArrayList<>();
        for(MenuVo menuVo : menuVoList){
            if(menuVo.getParentId() == 0){
                rootMenu.add(menuVo);
            }
        }
        return rootMenu;
    }
}
